<html>
<head>
  <script src="../lib/OpenLayers.js"></script>
  <script type="text/javascript"><!--
    var layer; 

    function test_01_Layer_constructor (t) {
        t.plan( 2 );
        
        layer = new OpenLayers.Layer('Test Layer');
        t.ok( layer instanceof OpenLayers.Layer, "new OpenLayers.Layer returns object" );
        t.eq( layer.name, "Test Layer", "layer.name is correct" );
    }

    function test_99_Layer_destroy (t) {
        t.plan( 1 );    
        layer = new OpenLayers.Layer('Test Layer');
        var map = new OpenLayers.Map('map');
        map.addLayer(layer);
        layer.destroy();
        t.eq( layer.map, null, "layer.map is null after destroy" );
    }
  // -->
  </script>
</head>
<body>
  <div id="map"></div>
</body>
</html>
